{OVERALL_HEADER}
<script>
function count(field,left,togo,maxchars) 
{
	var msgString = field.value;
	var msgLength = msgString.length;
		
	if (msgLength > maxchars) 
	{
		field.value = field.value.substr(0,(maxchars-5));
		msgLength=(maxchars-5);
		alert("{LANG_REACHED}");
	}
	document.getElementById(left).innerHTML = maxchars-msgLength;

}
</script>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" valign="top">
	  <a href="{SITE_URL}editprofile.php">{LANG_EDITPROFILE}</a><br>
      <a href="{SITE_URL}add_story.php">{LANG_SUBMITS}</a><br>
      <a href="{SITE_URL}logout.php">{LANG_LOGOUT}</a><br>
      <br>
	  <strong>{LANG_CATS}</strong><br>
      <br>
      {LOOP: CATS}
	  IF("{CATS.parent_id}"!="0"){&nbsp;&nbsp;{:IF}
	  <a href="{CATS.cat_url}">{CATS.cat_title}</a><br>
	  {/LOOP: CATS}
	  <br>
    <br></td>
    <td valign="top"><strong>{LANG_ADDSTORY}</strong><br>
    <br>
    <form name="add_story" id="add_story" method="post" action="add_story.php" style="padding:0px;margin:0px;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><strong>Story URL </strong></td>
        </tr>
        <tr>
          <td>{STORY_URL_FIELD}</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td><strong>{LANG_STORYTITLE}</strong></td><td align="right"><span id="title_count">{TITLE_COUNT}</span> {LANG_CHARSLEFT}</td>
            </tr></table></td>
        </tr>
        <tr>
          <td><input name="story_title" type="text" id="story_title" onblur="count(document.add_story.story_title,'title_count','',80)" onKeyPress="count(document.add_story.story_title,'title_count','',80)" onKeyUp="count(document.add_story.story_title,'title_count','',80)" value="{TITLE_FIELD}" style="width:500px;" maxlength="80"></td>
        </tr>
		<tr>
		<td><span class="error">{TITLE_ERROR}</span></td>
		</tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><td><strong>{LANG_STORYDESC}</strong></td><td align="right"><span id="desc_count">{DESC_COUNT}</span> {LANG_CHARSLEFT}</td>
            </tr></table></td>
        </tr>
        <tr>
          <td><textarea name="story_desc" rows="6" id="story_desc" style="width:500px;" onblur="count(document.add_story.story_desc,'desc_count','',400)" onKeyPress="count(document.add_story.story_desc,'desc_count','',400)" onKeyUp="count(document.add_story.story_desc,'desc_count','',400)">{DESC_FIELD}</textarea></td>
        </tr>
		<tr>
		<td><span class="error">{DESC_ERROR}</span></td>
		</tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
		IF("{TAGS_EN}"=="1"){
		<tr>
          <td><strong>{LANG_TAGTITLE}</strong> (Seperated by , (Comma))</td>
        </tr>
        <tr>
          <td><input name="story_tags" type="text" id="story_tags" value="{TAGS_FIELD}" style="width:500px;" maxlength="100"></td>
        </tr>
		<tr>
		<td><span class="error">{TAGS_ERROR}</span></td>
		</tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
		{:IF}
        <tr>
          <td><strong>{LANG_STORYCAT}</strong></td>
        </tr>
        <tr>
          <td>
		  <table border="0" cellpadding="0" cellspacing="0">
		  {LOOP: FIELD_CATS}
		  IF("{FIELD_CATS.cat_subs}"=="0"){<tr><td align="left"><input name="story_category" id="story_category" type="radio" value="{FIELD_CATS.cat_id}" {FIELD_CATS.checked}></td><td>{FIELD_CATS.cat_title}</td></tr>{:IF}
		  IF("{FIELD_CATS.cat_subs}"!="0"){<tr><td align="left" colspan="2" style="padding-left:5px;">{FIELD_CATS.cat_title}</td></tr>{:IF}
		  {/LOOP: FIELD_CATS}
		</table>
		  </td>
        </tr>
		<tr>
		<td><span class="error">{CATEGORY_ERROR}</span></td>
		</tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
		IF("{SECURITY_CODE}"=="1"){
        <tr>
          <td><strong>Security Word</strong></td>
        </tr>
        <tr>
          <td><img src="seccode.php"><br>
            <input name="security_code" type="text" id="security_code"><br>
		    Type in the word exactly as you see it above<br><span class="error">{SECURITY_ERROR}</span></td></tr>
			{:IF}
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><input type="submit" name="Submit" value="{LANG_SUBMITS}">
            <input name="story_url" type="hidden" id="story_url" value="{STORY_URL_FIELD}">
			<input name="dupe" type="hidden" id="dupe" value="1"></td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
{OVERALL_FOOTER}